<template>
  <div class="list">
    <header>分类</header>
    <section>
      <!-- 左 -->
      <div class="list-l">
        <ul class="l-item">
          <li>ZTE中兴</li>
          <li>nubia</li>
          <li>红魔</li>
          <li>其他</li>
        </ul>
        <ul class="l-item">
          <li>ZTE中兴</li>
          <li>nubia</li>
          <li>红魔</li>
          <li>其他</li>
        </ul>
        <ul class="l-item">
          <li>ZTE中兴</li>
          <li>nubia</li>
          <li>红魔</li>
          <li>其他</li>
        </ul>
        <ul class="l-item">
          <li>ZTE中兴</li>
          <li>nubia</li>
          <li>红魔</li>
          <li>其他</li>
        </ul>
        <ul class="l-item">
          <li>ZTE中兴</li>
          <li>nubia</li>
          <li>红魔</li>
          <li>其他</li>
        </ul>
        <ul class="l-item">
          <li>ZTE中兴</li>
          <li>nubia</li>
          <li>红魔</li>
          <li>其他</li>
        </ul>
      </div>
      <!-- 右 -->
      <div class="list-r">
        <ul>
          <!-- 每一大模块 -->
          <li class="shop-list">
            <div>
              <img
                src="https://image.ztemall.com/b3eba55e759452cbe76e999239c47087.jpg"
                alt=""
              />
            </div>
            <h2>ZTE中兴</h2>
            <!-- 每一块的信息展示 -->
            <ul class="r-content">
              <!-- 一条数据 -->
              <li>
                <img
                  src="https://image.ztemall.com/50f5a68e7b0b6323c40d9a5ca1cb4ab3.png"
                  alt=""
                />
                <span>中兴Axon40Ultra</span>
              </li>
              <li>
                <img
                  src="https://image.ztemall.com/50f5a68e7b0b6323c40d9a5ca1cb4ab3.png"
                  alt=""
                />
                <span>中兴Axon40Ultra</span>
              </li>
              <li>
                <img
                  src="https://image.ztemall.com/50f5a68e7b0b6323c40d9a5ca1cb4ab3.png"
                  alt=""
                />
                <span>中兴Axon40Ultra</span>
              </li>
              <li>
                <img
                  src="https://image.ztemall.com/50f5a68e7b0b6323c40d9a5ca1cb4ab3.png"
                  alt=""
                />
                <span>中兴Axon40Ultra</span>
              </li>
              <li>
                <img
                  src="https://image.ztemall.com/50f5a68e7b0b6323c40d9a5ca1cb4ab3.png"
                  alt=""
                />
                <span>中兴Axon40Ultra</span>
              </li>
            </ul>
          </li>
        </ul>
        <ul>
          <!-- 每一大模块 -->
          <li class="shop-list">
            <div>
              <img
                src="https://image.ztemall.com/b3eba55e759452cbe76e999239c47087.jpg"
                alt=""
              />
            </div>
            <h2>ZTE中兴</h2>
            <!-- 每一块的信息展示 -->
            <ul class="r-content">
              <!-- 一条数据 -->
              <li>
                <img
                  src="https://image.ztemall.com/50f5a68e7b0b6323c40d9a5ca1cb4ab3.png"
                  alt=""
                />
                <span>中兴Axon40Ultra</span>
              </li>
              <li>
                <img
                  src="https://image.ztemall.com/50f5a68e7b0b6323c40d9a5ca1cb4ab3.png"
                  alt=""
                />
                <span>中兴Axon40Ultra</span>
              </li>
              <li>
                <img
                  src="https://image.ztemall.com/50f5a68e7b0b6323c40d9a5ca1cb4ab3.png"
                  alt=""
                />
                <span>中兴Axon40Ultra</span>
              </li>
              <li>
                <img
                  src="https://image.ztemall.com/50f5a68e7b0b6323c40d9a5ca1cb4ab3.png"
                  alt=""
                />
                <span>中兴Axon40Ultra</span>
              </li>
              <li>
                <img
                  src="https://image.ztemall.com/50f5a68e7b0b6323c40d9a5ca1cb4ab3.png"
                  alt=""
                />
                <span>中兴Axon40Ultra</span>
              </li>
            </ul>
          </li>
        </ul>
      </div>
    </section>
    <!-- <footer>底部</footer> -->
  </div>
</template>

<script>
import axios from "axios";
export default {
  data() {
    return {
      data: [],
    };
  },
  created() {
    axios.get("http://localhost:4399/data").then((res) => {
      // console.log(res.data)
      let arr = [];
      res.data.forEach((element) => {
    // console.log(element);
        element.lv2.forEach((item) => {
        // console.log(item.adver_list);
        arr.push(item.adver_list) 
        })
      });
      this.data=arr
      // console.log(this.data)
   
   // res.data.forEach((element) => {
      //   arr.push(element.lv2);
      //   arr.forEach((item) => {
      //    arr3.push(item)
      //    arr3.forEach((i) => {
      //       arr1.push(i);
      //     });
      //   });
      //   console.log(arr1);
      // });

      // console.log(res.data.foreach((item)=>{

      // }))
    });
  },
  mounted() {},
};
</script>

<style lang="scss" scoped>
.list {
  display: flex;
  flex-direction: column;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  header {
    height: 50px;
    line-height: 50px;
    font-size: 18px;
    text-align: center;
    /* background-color: pink; */
  }
  section {
    display: flex;
    flex: 1;
    overflow: auto;
    .list-l {
      width: 93px;
      height: 100%;
      border: 2px solid #f7f7f7;
      display: flex;
      flex-direction: column;
      overflow: auto;
      .l-item {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        li {
          width: 100%;
          line-height: 55px;
          text-align: center;
          &.active {
            border-left: 3px solid #b54f4a;
          }
        }
      }
    }
    .list-r {
      width: 100%;
      height: 100%;
      overflow: auto;
      background-color: #f7f7f7;
      .shop-list {
        text-align: center;
        div {
          display: flex;
          justify-content: center;
          height: 79px;
          margin-top: 15px;

          img {
            display: block;
            width: 90%;
            height: 100%;
            border-radius: 10px;
          }
        }
        h2 {
          height: 54px;
          line-height: 54px;
          font-size: 15px;
          font-weight: normal;
          /* background-color: skyblue; */
        }
        .r-content {
          display: flex;
          flex-wrap: wrap;
          justify-content: space-between;
          margin: 0 13px;
          /* background-color: rgb(116, 227, 116); */
          background-color: #ffffff;
          border-radius: 10px;
          font-size: 12px;
          padding-bottom: 15px;

          /* 每一小块 */
          img {
            width: 100%;
          }
          span {
            display: block;
            height: 25px;
            line-height: 25px;
          }
          li {
            width: 45%;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
          }
        }
      }
    }
  }
}

footer {
  height: 55px;
  line-height: 55px;
  text-align: center;
  background-color: pink;
}
</style>
